@extends('admin.common.web')

@section('title','权限列表')

@section('content')
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="#">系统</a>
            </li>
            <li class="active">权限管理</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->

    <!-- Page Body -->
    <div class="page-body">
        @include('admin.common.msg')

        <button type="button" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{{ route('admin.permission.create') }}'">
            <i class="fa fa-plus"></i> 添加权限
        </button>
        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget">
                    <div class="widget-body">
                        <div class="flip-scroll">
                            <table class="table table-bordered table-hover">
                                <thead class="">
                                <tr>
                                    <th class="text-center">ID</th>
                                    <th class="text-center">权限名称</th>
                                    {{--<th class="text-center">上级权限</th>--}}
                                    <th class="text-center">权限路由</th>
                                    <th class="text-center">添加时间</th>
                                    <th class="text-center">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($permissionList as $v)
                                <tr>
                                    <td align="center">{{ $v['id'] }}</td>
                                    <td><?php echo str_repeat('----',$v['level'])?>{{ $v['permission_name'] }}</td>
{{--                                    <td align="center">{{ $v['parent']['permission_name'] }}</td>--}}
                                    <td align="center">{{ $v['route_url'] }}</td>
                                    <td align="center">{{ $v['created_at'] }}</td>
                                    <td align="center">
                                        <a href="{{ route('admin.permission.edit',['id'=>$v['id']]) }}" class="btn btn-primary btn-sm shiny">
                                            <i class="fa fa-edit"></i> 编辑
                                        </a>
                                        <a href="{{ route('admin.permission.destroy',['id'=>$v['id']]) }}" onClick="confirm('确定要删除吗？');" class="btn btn-danger btn-sm shiny">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </a>
                                    </td>
                                </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                        <div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
@endsection